[20250314] BOJ / G3 / 피리 부는 사나이 / 김수연 #244
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧷 문제 링크
https://www.acmicpc.net/problem/16724
🧭 풀이 시간
60분
👀 체감 난이도
✏️ 문제 설명
성우가 피리를 불면 회원들은 성우가 정해놓은 방향대로 움직이기 시작한다.
특정 지점에 세이프존을 만들어서 피리 소리를 듣지 못하게 하려고 한다.
회원들이 어느 구역에 있더라도 세이프존에 들어갈 수 있도록 할 때, 세이프 존의 최소 개수를 구하기
🔍 풀이 방법
dfs 이용해서 방문하지 않은 점을 기준으로 탐색을 시작하고,
방문 했던 점에 방문하면 사이클 검사를 하고, answer를 하나 늘린다.
⏳ 회고
간단한거 같은데 어렵다..